home *** CD-ROM | disk | FTP | other *** search
- Path: red.weeg.uiowa.edu!hayhurst
- From: Lyle <hayhurst@blue.weeg.uiowa.edu>
- Newsgroups: comp.lang.c++
- Subject: passing pointers to functions
- Date: Wed, 31 Jan 1996 10:57:13 -0600
- Organization: University of Iowa, Iowa City, IA, USA
- Distribution: world
- Message-ID: <Pine.A32.3.91.960131105301.69201A-100000@red.weeg.uiowa.edu>
- NNTP-Posting-Host: red.weeg.uiowa.edu
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Sender: hayhurst@red.weeg.uiowa.edu
-
-
-
- Hello all, this is a newbie question.
-
- I want to pass an empty pointer to a function.
-
- Inside the function, I create an array. Then I set the
- pointer_to_array = &A[0]. Finally at the end of the function I return
- the pointer_to_array to my main.
-
- void main ()
- {
- int *A1 = NULL;
- A1 = MakeArray(A1);
- cout << "First element in Array is" << *A1;
- }
-
- My specific question is: what should my function header look like?
- My general question is: what are the rules for passing (and returning)
- pointers to functions w/ call by reference,parameter, and constant reference?
-
- Thanx! --Lyle
-
-
-